<template>
  <div class="pay">
    <h3><i class="el-icon-document"></i>&nbsp;购买信息</h3>
    <ul>
      <el-row>
        <el-col :span="6">设备ID</el-col>
        <el-col :span="18">{{ nvr_id }}  &nbsp;</el-col>
      </el-row>
      <el-row>
        <el-col :span="6">设备名称</el-col>
        <el-col :span="18">{{ nvr_name == null ? '无': nvr_name }}  &nbsp;</el-col>
      </el-row>
      <el-row>
        <el-col :span="6">设备IMEI</el-col>
        <el-col :span="18">{{ nvr_IMEI }}  &nbsp;</el-col>
      </el-row>
       <el-row>
        <el-col :span="6">购买方式</el-col>
        <el-col :span="18">永久购买</el-col>
     </el-row>
    </ul>
    <div id="money">
      总金额：¥ <span>{{ purchaseInstallments }}</span>
    </div>

    <el-button type="primary" class="paypage" @click="paypage">购&nbsp;买</el-button>
    <pay-page
      v-show="page"
      :payb="page"
      @child-msg="getChildMsg"
      :Date_start="Date_start"
      :Date_end="Date_end"
      :totalMoney="this.permanentPurchase"
      :idays="iDays"
      :IMEI="this.nvr_IMEI"
      :ind="ind"
    ></pay-page>
  </div>
</template>
<script>
import PayPage from "@/components/PayPage";
export default {
  data() {
    return {
      page: false,
      Date_start: "",
      Date_end: "",
      iDays: 0,
      ind: 0, //支付类型 0永久购买
    };
  },
  methods: {
    paypage() {
      if(!this.permanentPurchase == undefined){
        this.$message({
          message: "获取设备信息有误,请联系客服!!",
          type: "warning",
          offset: 80,
        });
      }else{
        this.page = true;
      }
    },
    getChildMsg(msg) {
      this.page = msg;
    },
  },
  props: [
    "nvr_IMEI",
    "permanentPurchase", //总金额
    "purchaseInstallments", //分期金额
    "nvr_id",
    "nvr_name",
  ],
  components: {
    PayPage,
  },
  mounted() {
    this.ime = this.nvr_IMEI;
  },
};
</script>
<style lang="scss" scoped>
.pay {
  padding: 0.25rem;
}

ul {
  padding: 0.2rem 0 0.3rem 0;
  li {
   
    text-align: left;
  }
}

.paypage {
  width: 80%;
  margin-top: 0.7rem;
}
</style>